<div class="gcontainer clearfix">
	<?php
		if(count($this->arrItems)):
		 	$tmpcount=0;
		  	$pagecount=0;
			foreach($this->arrItems as $item)
			{
			 	if($pagecount!=0)
        			$style="style=\"display:none\"";
       			else
        			$style=""; 
			 	if($tmpcount%$pager==0)
			 	{
			 		$tmppage=$tmpcount/$pager;
					echo "<div id=\"subcontainer".$tmppage."\" ".$style.">";
					$pagecount++;
				}
				echo $item;
				if(($tmpcount+1)%$pager==0)
			  	{
			     	$tmppage=$tmpcount/$pager;
			     	echo "</div>";
        		}
        		$tmpcount++;
			}
			if($tmpcount%$pager!=0):
				echo "</div>";
			endif;
		else:
			echo Yii::t('app', 'This gallery is empty');
		endif;

	?>
</div>
<div class="pager">
<span class="disabled">&lt;</span>
<?php
for($i=0;$i<$pagecount;$i++)
{
	$j=$i+1;
	echo "<span onClick=\"changepage(".$i.",".$pagecount.")\" id=\"pagebutton".$i."\">".$j."</span>";
} 
?>
<span class="current">&gt;</span>
</div>
<script>
function changepage(page,allpage)
{
	for(i=0;i<allpage;i++)
	{
		id="subcontainer"+i;
		idbutton="pagebutton"+i;
		document.getElementById(id).style.display="none";
		document.getElementById(idbutton).className="";
	}
	id="subcontainer"+page;
	idbutton="pagebutton"+page;
	document.getElementById(id).style.display = "";
	document.getElementById(idbutton).className="current";
}
</script>

